package com.atguigu.gmall.feign.search;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.search.bean.Goods;
import com.atguigu.gmall.search.vo.SearchParamVo;
import com.atguigu.gmall.search.vo.SearchRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("service-search")
@RequestMapping("/api/inner/rpc/search")
public interface SearchFeignClients {

    /**
     * 商品上架
     * @param goods
     * @return
     */
    @PostMapping("up/goods")
     Result up (@RequestBody Goods goods);


    /**
     * 商品下架
     * @param skuId
     * @return
     */
    @GetMapping("/down/goods/{skuId}")
     Result down(@PathVariable("skuId") Long skuId);


    /**
     * 根据索引查询goods
     * @param param
     * @return
     */
    @PostMapping("/searchgoods")
     Result<SearchRespVo> search(@RequestBody SearchParamVo param);


    /**
     * 增加热度分
     * @param skuId
     * @param score
     */
    @GetMapping("/hotscore/{skuId}/{score}")
    void updateHotScore(@PathVariable Long skuId,@PathVariable Long score);
}
